package br.slic.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class DadosUtil {

	public static boolean isEmpty(Long l) {
		return l == null || l.longValue() == 0;
	}

	public static boolean isEmpty(Object[] v) {
		return v == null || v.length == 0;
	}
	
	public static boolean isEmpty(String str) {
		return str == null || str.isEmpty() || str.trim().equals("");
	}
	
	public static String gerarSenha(String str) throws NoSuchAlgorithmException {  
		MessageDigest md = MessageDigest.getInstance("MD5");  
		BigInteger hash = new BigInteger(1, md.digest(str.getBytes()));  
		return  hash.toString(16);		
	}

}
